package com.xiaou.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.xiaou.pojo.Orders;
import com.xiaou.service.OrdersService;

@Controller
public class OrdersController {
	@Autowired
	private OrdersService ordersService;
	@RequestMapping("/orderList.action")
	public ModelAndView list() {
		List<Orders> list = ordersService.findAllOrder();
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.addObject("ordersList",list);
		modelAndView.setViewName("/orders");
		return modelAndView;
		
	}
}
